package cn.school.basics.vo;


import cn.school.common.BaseTreeNode;
import lombok.Data;

@Data
public class LocationTreeNode extends BaseTreeNode {
    private String level;

    public void init(BaseSpaceLocationVO baseSpaceLocationVO) {
        super.init(baseSpaceLocationVO.getId(), baseSpaceLocationVO.getLocationPid(), baseSpaceLocationVO.getLocationName());
        this.level = baseSpaceLocationVO.getLevel();
    }

    public LocationTreeNode addChildren(BaseSpaceLocationVO baseSpaceLocationVO) {
        LocationTreeNode childrenNode = new LocationTreeNode();
        childrenNode.init(baseSpaceLocationVO);
        super.addChildren(childrenNode);
        return childrenNode;
    }

}
